/**
 * controller 
 *
 * @param
 */
const fs = require('fs');
const path = require('path');

var controller = {};

// read all controllers and import them into the "controller" object
fs
  .readdirSync(__dirname + '/')
  .filter(file => {
    return file.indexOf('.') !== 0 && file !== 'index.js';
  })
  .forEach(fileName => {
    const pathName = __dirname + '/' + fileName;
    const file = path.parse(pathName);
    controller[file.name] = require(pathName);
  });

controller.empty = async function() {
  this.body = {
    data: 'developing...',
  };
};

module.exports = controller;
